using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
using UMC.Data;

namespace UMC.Web
{
    /// <summary>
    /// PC端二维码扫码对话框
    /// </summary>
    public class UIScanQRDialog : UIDialog
    {
        protected override string DialogType
        {
            get { return "ScanQR"; }
        }
        public UIScanQRDialog(String qrValue)
        {
            this.Config.Put("Url", qrValue);
        }

        public UIScanQRDialog(String qrValue, String host, string device)
        {
            this.Config.Put("Url", qrValue);
            this.Config.Put("Host", host).Put("Device", device);
        }
        protected override void Initialization(WebContext context)
        {
            base.Initialization(context);
            if (this.Config.ContainsKey("Device") == false)
            {
                this.Config.Put("Device", Utility.Guid(context.Token.Device.Value));
            }
            if (this.Config.ContainsKey("Host") == false)
            {
                this.Config.Put("Host", context.Request.Url.Host);
            }
        }

        public string Url
        {
            get
            {
                return this.Config.Get("Url");
            }
            set
            {
                this.Config.Put("Url", value);
            }
        }
         public string ButtonText
        {
            get
            {
                return this.Config.Get("ButtonText");
            }
            set
            {
                this.Config.Put("ButtonText", value);
            }
        }
        public string Desc
        {
            get
            {
                return this.Config.Get("Desc");
            }
            set
            {
                this.Config.Put("Desc", value);
            }
        }
        //关闭的数据事件
        public string DataEvent
        {
            get
            {
                return this.Config.Get("DataEvent");
            }
            set
            {
                this.Config.Put("DataEvent", value);
            }
        }
    }
}
